const express = require("express");
const router = express.Router();
const FeedbackModule = require("../../../api/feedback");
const {
  feedbackList,
  addFeedback,
  updateFeedback,
  removeFeedback,
} = require("../../../api/feedback");
router.get("/list", (req, res) => {
  feedbackList(req.query)
    .then((r) => res.send(r))
    .catch((e) => res.send(e));
});
router.get("/get", (req, res) => {
  feedbackList(req.query)
    .then((r) => res.send(r))
    .catch((e) => res.send(e));
});
router.post("/add", (req, res) => {
  addFeedback(req.body)
    .then((r) => res.send(r))
    .catch((e) => res.send(e));
});
router.post("/update", (req, res) => {
  updateFeedback(req.body)
    .then((r) => res.send(r))
    .catch((e) => res.send(e));
});
router.post("/remove", (req, res) => {
  removeFeedback(req.body)
    .then((r) => res.send(r))
    .catch((e) => res.send(e));
});

router.get("/GetFeedbackTypeList", (req, res) => {
  FeedbackModule.FeedbackTypeList(req)
    .then((r) => res.send(r))
    .catch((e) => res.send(e));
});
router.post("/CreateFeedbackType", (req, res) => {
  FeedbackModule.CreateFeedbackType(req)
    .then((r) => res.send(r))
    .catch((e) => res.send(e));
});
router.post("/DeleteFeedbackType", (req, res) => {
  FeedbackModule.DeleteFeedbackType(req)
    .then((r) => res.send(r))
    .catch((e) => res.send(e));
});
router.post("/UpdateFeedbackType", (req, res) => {
  FeedbackModule.UpdateFeedbackType(req)
    .then((r) => res.send(r))
    .catch((e) => res.send(e));
});
module.exports = router;
